# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kdesu
pkgver=5.73.0
pkgrel=0
pkgdesc="Integration with su for elevated privileges"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only"
depends_dev="kcoreaddons-dev ki18n-dev kservice-dev kpty-dev"
makedepends="$depends_dev extra-cmake-modules qt5-qttools-dev doxygen"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kdesu-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
# Since the goal of this library is to elevate privileges, suid being needed should be obvious
options="suid"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="331faee23d9946ea81b57a25bc52fdc4985e04c7373225d8fe7d5b285a6de3fce1b161453357dd6886778080e6d59a9f11c9db866d0dff99c1d7a08be656df4e  kdesu-5.73.0.tar.xz"
